rules:
  - id: {{ check_id }}
    message: {{ message }}
    languages: [python]
    severity: WARNING
    patterns:
      - pattern-inside: |
          def $FUNC(...):
            ...
      - pattern-either:
{%- for data_pattern in request_data_patterns %}
        - pattern: {{ sink }}(..., $S.format(..., {{ data_pattern }}, ...), ...)
        - pattern: {{ sink }}(..., $S % {{ data_pattern }}, ...)
        - pattern: {{ sink }}(..., f"...{{ '{' }}{{ data_pattern }}{{ '}' }}...", ...)
  {%- for left_pattern in left_patterns %}
        - pattern: {{ left_pattern }}{{ sink }}(..., {{ data_pattern }}, ...)
    {%- for format_pattern in format_patterns %}
        - pattern: |
            $DATA = {{ data_pattern }}
            ...
            {{ left_pattern }}{{ sink }}(..., {{ format_pattern }}, ...)
        - pattern: |
            $DATA = {{ data_pattern }}
            ...
            $INTERM = {{ format_pattern }}
            ...
            {{ left_pattern }}{{ sink }}(..., $INTERM, ...)
    {%- endfor -%}
  {%- endfor -%}
{%- endfor -%}